      SUBROUTINE UTTERM 
*-----------------------------------------------------------------------
*   
*--- user total termination 
*   
*-----------------------------------------------------------------------
      include 'PARAM.h' 
      include 'ALCAZA.h' 
      include 'CLASS.h' 
      include 'CURSTA.h' 
      include 'FLWORK.h' 
      include 'KEYCOM.h' 
      include 'TYPDEF.h' 
      include 'JOBSUM.h' 
      include 'STATE.h' 
      include 'FLAGS.h' 
      include 'USIGNO.h' 
      include 'USINFN.h' 
      include 'CHECKS.h' 
      LOGICAL BTEST 
      CHARACTER*(MXNMCH) CNAM   
      IF(UNFLP) RETURN  
      WRITE(MPUNIT,500) 
      DO 70 I=1,NGNAME  
         NTYP = NAMTYP(IGNAME+I)
         CNAM = SNAMES(IGNAME+I)
         DO 10 IGN=1,NIGNOR 
            IF(LIGNOR(IGN).NE.INDEX(CNAM,' ')-1)                 GOTO 10
            IF(CIGNOR(IGN)(:LIGNOR(IGN)).EQ.CNAM(:LIGNOR(IGN)))  GOTO 70
   10    CONTINUE   
C check for use of obsolete CERN library routines   
         IF(LCHECK(33).AND.(BTEST(NTYP,16).OR.BTEST(NTYP,14))) THEN 
            CALL CHKOBS(CNAM,IWARN) 
            IF(IWARN.NE.0) THEN 
               WRITE(MPUNIT,560) CNAM   
            ENDIF   
         ENDIF  
         IF(LCHECK(32).AND.BTEST(NTYP,7)) THEN  
C sort common block names.  
            DO 20 II=0,19   
               IF(II.EQ.7)                                       GOTO 20
               IF(BTEST(NTYP,II)) THEN  
                  WRITE(MPUNIT,510) CNAM
               ENDIF
   20       CONTINUE
         ENDIF  
         IF(BTEST(NTYP,16)) THEN
C FUNCTION  
            ILEN = INDEX(CNAM,' ')-1
               DO 30 INF=1,LIF  
                  IF(INDEX(CINFUN(INF),' ')-1.EQ.ILEN) THEN 
                     IF(CINFUN(INF).EQ.CNAM) THEN   
                        IF(LCHECK(34).AND.BTEST(NTYP,11))   
     &          WRITE(MPUNIT,520) CNAM  
                                                                 GOTO 40
                     ENDIF  
                  ENDIF 
   30          CONTINUE 
            IF(LCHECK(35).AND..NOT.BTEST(NTYP,11)) WRITE(MPUNIT,530)
     +      CNAM
   40       CONTINUE
         ENDIF  
C Check for clashes between SUBROUTINE,BLOCKDATA,PROGRAM,ENTRY,FUNCTION 
         IF(LCHECK(36)) THEN
            DO 60 ITY=12,16 
               IF(.NOT.BTEST(NTYP,ITY))                          GOTO 60
               DO 50 ITY2=12,16 
                  IF(ITY.EQ.ITY2)                                GOTO 50
                  IF(.NOT.BTEST(NTYP,ITY2))                      GOTO 50
                  WRITE(MPUNIT,540) CNAM
                                                                 GOTO 70
   50          CONTINUE 
   60       CONTINUE
         ENDIF  
   70 CONTINUE  
      WRITE(MPUNIT,550) 
  500 FORMAT(/,1X,20('+'), ' BEGIN GLOBAL MODULE CHECKS   ',10('+'))
  510 FORMAT(1X,'!!! WARNING ... VARIABLE ',A,  
     +' IS NAME OF COMMON BLOCK AND OTHER') 
  520 FORMAT(1X,'!!! WARNING ... FUNCTION ',A,  
     +' IS EXTERNAL BUT CLASHES WITH INTRINSIC FUNCTION')   
  530 FORMAT(1X,'!!! WARNING ... FUNCTION ',A,  
     +' IS NOT INTRINSIC, AND IS NOT DECLARED "EXTERNAL"')  
  540 FORMAT(1X,'!!! WARNING ... MODULE ',A,
     +' HAS NAME CLASH WITH OTHER MODULE')  
  550 FORMAT(1X,20('+'), ' END GLOBAL MODULE CHECKS     ',10('+'),//)   
  560 FORMAT(1X,'!!! WARNING ... "',A,  
     +'" IS OBSOLETE CERN LIBRARY ROUTINE') 
      END   
